<template>
  <div>
    <el-form label-width="100px" :inline="true">
      <el-form-item label="名称">
        <el-input v-model="searchForm.title" placeholder="请输入名称" size="small"/>
      </el-form-item>

      <el-form-item label=" ">
        <el-button size="mini" @click="handleSearch()" icon="el-icon-search" type="primary">查询</el-button>
        <el-button size="mini" @click="handleReset()">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  props: ['categoryData'],
  components: {},
  data() {
    return {
      //查询条件
      searchForm: {
        title: "",
      },
    }
  },
  created() {
  },
  methods: {

    //父页面的回调事件
    handleParentEvent() {
      this.$emit('setSearchForm', this.searchForm)
    },
    //创建
    handleSearch() {
      this.handleParentEvent()
    },
    handleReset() {
      this.searchForm = {
        title: "",
      };
      this.handleParentEvent()
    },
  }
}
</script>

<style scoped>

</style>
